from django.db import models

# Create your models here.


class Node(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=50, verbose_name='名称')
    belong_to = models.CharField(max_length=50, verbose_name='结点归类')
    desc = models.CharField(max_length=50, verbose_name='描述')
    identifier = models.CharField(max_length=7, verbose_name='节点标识')    # 前三位标识书本标记，4-5位表示章节标记，6-7位表示小节标记
    is_delete = models.BooleanField(default=False, verbose_name='是否删除节点标记')
    category = models.IntegerField(verbose_name='结点类别')


class Edge(models.Model):
    id = models.AutoField(primary_key=True)
    source = models.CharField(max_length=50, verbose_name='源点名称')
    target = models.CharField(max_length=50, verbose_name='终点名称')
    value = models.CharField(max_length=50, verbose_name='关系名称')
    is_delete = models.BooleanField(default=False, verbose_name='是否删除节点标记')

